load("//bazel:mongo_src_rules.bzl", "mongo_cc_library", "mongo_cc_unit_test")

package(default_visibility = ["//visibility:public"])

exports_files(
    glob([
        "*.h",
        "*.cpp",
    ]),
)

mongo_cc_library(
    name = "mutable_bson",
    srcs = [
        "document.cpp",
        "element.cpp",
    ],
    mongo_api_name = "mutable_bson",
    deps = [
        "//src/mongo:base",
        "//src/mongo/util:safe_num",
    ],
)

mongo_cc_library(
    name = "mutable_bson_test_utils",
    srcs = [
        "mutable_bson_test_utils.cpp",
    ],
    deps = [
        ":mutable_bson",
        "//src/mongo/db/query/collation:collator_interface_mock",
        "//src/mongo/unittest",
    ],
)

mongo_cc_unit_test(
    name = "bson_mutable_test",
    srcs = [
        "mutable_bson_algo_test.cpp",
        "mutable_bson_test.cpp",
    ],
    tags = ["mongo_unittest_third_group"],
    deps = [
        ":mutable_bson",
        ":mutable_bson_test_utils",
        "//src/mongo/db/query/collation:collator_interface_mock",
        "//src/mongo/db/shard_role/lock_manager",
        "//src/mongo/transport:transport_layer_common",
    ],
)
